The present invention is generally directed to an electronic control unit (ECU), and more specifically to the calibration of an ECU.
Various generic control algorithms have been developed for use with automotive electronic control units (ECUs), within various automotive subsystems. For example, generic control algorithms have been developed for a variety of engine control units, power-train control units and antilock braking system (ABS) units, to name a few. Because these control algorithms are generic, the calibration constants must be calibrated for each particular application (e.g., to achieve a different performance level from the same engine provided in multiple motor vehicle models). These calibration constants have typically been stored in calibration tables within a non-volatile memory of each ECU. During development, these calibration constants have normally been modified by closed-loop computer equipment or by vehicle system engineers, known as calibration engineers, via an external tool (e.g. a PC coupled to the microcontroller), in an attempt to determine ideal values for the calibration constants. These ideal values have typically been determined by modifying one or more of the calibration constants while monitoring the overall effect on the performance of the particular automotive subsystem.
Traditionally, a number of approaches have been utilized to facilitate calibration of electronic control units (ECUs). These approaches have included: using a read-only memory (ROM) emulation device to store calibration constants external to the ECU; integrating a calibration emulation device, which stores calibration constants, internal to the ECU; and overlaying a non-volatile memory with a volatile memory (e.g., random access memory (RAM)), where the non-volatile memory permanently stores calibration constants and the volatile memory typically contains calibration constants that may be modified and both memories are internal to a microcontroller of the ECU.
However, these approaches have certain shortcomings. For example, providing a ROM emulation device external to the ECU requires a development ECU design that includes a robust test connector for providing access to a parallel data bus of a development microcontroller (so that the microcontroller can access the calibration constants stored in the ROM) in the external tool. One disadvantage of this approach is that the test connector generally requires a large area of the development ECU substrate and the design and production of the emulation device can be fairly expensive.
In an effort to reduce the cost associated with the external calibration emulation device, calibration emulation memory, which has normally been accessed via a serial bus, was placed internal to the development ECU. However, providing the calibration emulation memory internal to the ECU has generally required a development microcontroller design with additional memory (as compared to the production microcontroller design), which requires additional ECU substrate and additional microcontroller chip select resources.
In a further effort to reduce the internal memory requirements of the development microcontroller, designers have utilized internal volatile memory (i.e., RAM) to overlay internal non-volatile memory, such that calibration constants loaded into the internal volatile memory from the internal non-volatile memory could be modified through the use of an external tool. However, implementing overlay RAM internal to the microcontroller has also generally required additional internal microcontroller RAM to support glue logic such that the RAM can overlay a certain area of non-volatile (e.g., flash) memory. Further, the additional internal RAM has typically been difficult to manipulate with external tools and, because the internal RAM is typically small in size and volatile, all calibration data has been required to be uploaded to an external tool before being reprogrammed into the internal non-volatile memory of the ECU.
This reprogramming activity may corrupt valuable information, such as xe2x80x98block learnxe2x80x99, i.e., information that has been learned, and other data stored within the ECU memories. The data corruption is attributable to the fact that programming a non-volatile memory has generally required that a sector be erased, before new data can be programmed to the sector. Further, when the non-volatile memory was being reprogrammed, these ECUs could not control their associated automotive subsystems while reprogramming. Reprogramming times, when using a serial external tool, can typically range from five to twenty minutes.
An alternative to uploading the modified calibration constants to the external tool, for reprogramming into the non-volatile memory of the ECU, is to create a power supply device that constantly provides power to an internal volatile memory that contains the calibration constants. However, this approach can increase standby current drawn by the ECU, which may be unacceptable. As a result of the above considerations, the cost of a typical development ECU has been considerably greater than the cost of a production ECU.
Thus, what is needed is an electronic control unit (ECU) whose calibration constants can be updated in a relatively short time period, without interrupting the normal operation of the ECU. Further, it is desirable to provide a production ECU that can also serve as a development ECU.
The present invention is directed to the calibration of an electronic control unit (ECU) that includes a microcontroller, a first non-volatile memory bank, a second non-volatile memory bank and a volatile memory. During calibration, the microcontroller is coupled to an external tool that allows a user to modify calibration constants that the microcontroller uses to control a subsystem coupled to the ECU. The first non-volatile memory bank is coupled to the microcontroller and initially stores a plurality of initial calibration tables. The second non-volatile memory bank and the volatile memory are also coupled to the microcontroller. The microcontroller executes code, which causes the microcontroller to perform a number of steps.
Initially, the microcontroller loads a plurality of initial calibration tables into the second non-volatile memory bank. Next, the microcontroller receives an indication as to which of the calibration tables loaded in the second non-volatile memory bank are to be modified. Based upon the received indication, the microcontroller loads at least one of the calibration tables into the volatile memory. Then, the microcontroller replaces an existing calibration constant, located within one of the calibration tables, loaded in the volatile memory. The microcontroller then executes a control algorithm utilizing the calibration tables, including any replacement calibration constant, loaded in the volatile memory, when required for a particular calibration routine.
Next, the microcontroller receives an indication that the calibration tables currently loaded into the volatile memory are to be loaded into the second non-volatile memory bank. During the process, the microcontroller executes the control algorithm utilizing the calibration tables loaded into the first non-volatile memory bank, until the calibration tables in the volatile memory are loaded into the second non-volatile memory bank.
These and other features, advantages and objects of the present invention will be further understood and appreciated by those skilled in the art by reference to the following specification, claims and appended drawings.